1. Field of the Invention
The present invention relates a technique for enabling a processor to process a command more appropriately.
2. Description of the Related Art
In recent years, in an attempt to enable a processor to utilize resources more effectively, a priority has been given to a process target command, and a wait queue (i.e., a command queue) has been generated by classifying the commands in accordance with the priority. For example, in a multi-processor system connecting a plurality of processors, it is common to assign a high priority to a command for sending data to another processor.
The provision of commands (i.e., a command queue) with order of priority enables selecting commands existing in the queue in accordance with the order of priority. If the frequency of issuing commands having high priority increases due to this practice, it becomes difficult to select commands having lower priority. If the frequency of a clock operating a processor has a large difference from that of the clock of an external bus, or if the width of the external bus is small, a substantially large number of clocks are required to output a command externally as a request. Because of this, when selecting a command to be output externally as a request, a situation tends to arise in which it is difficult to select a command having low priority even if the frequency of issuing command having high priority is not so high.
FIG. 1 is a time chart showing commands selected by the command numbers existing respectively in two command queues vested with different priority. FIG. 1 delineates (A): a command queue having high-priority (noted as “high-priority-queue” in FIG. 1) and (B): a command queue having lower-priority (noted as “low-priority-queue” in FIG. 1). The numerical values 4 through 8 are command numbers (cmd-num), “bus-en” is the timing of starting a command output to an external bus, “rls” is a command release (i.e., elimination from the queue), and “set” is a command setting (i.e., registration in the queue). An “(A)” noted for a command (i.e., data) output to the bus shows that the queue from which the command is selected is vested with the higher priority. As such, FIG. 1 shows the commands selected from two queues and then output to the bus, focusing on only the two command queues vested with different priority.
As shown in FIG. 1, the registration of a command in the command queue can be carried out in a shorter time than the time necessary for outputting a command to the bus. Because of this, a situation tends to arise in which a large number of commands remain in the command queue. If such a situation occurs in the high-priority queue, a command is not selected from the low-priority queue for a substantially long period of time.
Even if a command is of low priority, a non-selection of the command for a long period of time may cause an impediment in the progress of the processing. Not only decreasing performance, but also a hang-up may possibly result. Considering this, the avoidance of such a situation in which a command having low priority is not selected for a long period of time is considered to be very important.
The majority of the current processors are equipped with a pipeline for speeding up the processing by shortening the wait time for a command. Commands are throw into the pipeline in order of the readiness of the command. Some commands sometimes need a re-throw (i.e., a retry). The retry is carried out due to the competition with the preceding command, the status of usable resources, and the like.
When, for example, a register storing data necessary for executing a command is accessed by executing another command, or there is a need to access the register for the execution, the access to the register is limited and so the execution of the command cannot be completed. Therefore, the command needs a retry in such a case. In order to retain information (e.g., an address value) indicating the register to which the access is to be limited, a specific-use register (i.e., a logic register) is used.
The command in need of a retry is returned to the original queue and is re-throw into the pipeline. There is a possible case in which the retried command needs another retry for a similar reason and thus the retry will be repeated.
FIG. 2 is a time chart showing the progress of command processing by means of a pipeline. The horizontal axis represents time and the vertical axis represents stages. The interval between straight lines parallel to the vertical axis represents a time equivalent to one cycle of an operating clock. The number of stages in the pipeline is eight, and the “terraced” bold lines represent the transition of stages in keeping with an elapse of time. The bold line parallel to the horizontal axis represents a period in which a certain register is locked (i.e., an access is limited) resulting from executing a command. “(A)” represents a command to be retried, while “(B1)” and “(B2)” represent other commands which are not retried.
As shown in FIG. 2, a retry is required for the command (A) due to a register being locked by the preceding command, and also in the following re-throwing, another retry is required due to registers being locked by the preceding commands (B1) and (B2). As such, if commands utilizing the same resource (e.g., a register in this case) are alternately thrown in a certain cycle, a situation results in which retry is repeated for only the same command. Even if the cycle is not constant, there is a possibility that such retry would be repeated for only the same command. Since such a retry is caused by the limitation of a usable resource, the retry has no relationship with the priority of the command. That is, even if, for example, the command (A) is selected from a higher priority queue than that in which the commands (B1) and (B2) exist, there is a possibility of repeating retries for only the command (A). Such a situation tends to occur in a multi-core processor equipped with a plurality of core units.
A repetition of retries for the same command is equivalent to not executing the command for an extended period of time. This in turn generates an obstacle in the progress of the processing, resulting in the occurrence of degraded performance and/or hang-ups, as in the case of selecting commands in accordance with the order of priority. In consideration of this, it is considered to be important to avoid the situation in which the retries are repeated for a command.